//
//  TextDialogLayer.h
//  NinjaTurtle
//
//  Created by Nguyen Tri Chung on 2/24/15.
//
//

#ifndef __NinjaTurtle__TextDialogLayer__
#define __NinjaTurtle__TextDialogLayer__

#include <stdio.h>
#include "cocos2d.h"
#include "../model/model.h"
#include "../support/support.h"

USING_NS_CC;

class TextDialogLayer : public Layer {
    CC_SYNTHESIZE(MenuItemSprite*, button1, Button1);
    CC_SYNTHESIZE(MenuItemSprite*, button2, Button2);
    CC_SYNTHESIZE(Label*, dialogText, DialogText);
    CC_SYNTHESIZE(Label*, dialogTitle, DialogTitle);
    
    CC_SYNTHESIZE_READONLY(Vector<MenuItemSprite*>*, parentButtons, ParentButtons);
protected:
    Layer* mainLayer;
    Menu* mainMenu;
    CSprite* dialogFace;
    LayerColor* backgroundLayer;

    View* parent;
public:
    TextDialogLayer(View* parent);
    virtual ~TextDialogLayer();
    
    void initialize();
    void createLayers();
    void createLayersContent();
    void functionCallback(const string& data);
    
    void showConfirmDialog(const string& content, const string& title, const string& button1Text, const string& button2Text);
    void showDialog(const string& content, const string& title, const string& button1Text);
    void hide();
    
    void enableParentButton(bool enabled);
    void enableButton(bool enabled);
};

#endif /* defined(__NinjaTurtle__TextDialogLayer__) */
